import Vue from 'vue'

Vue.directive('anchor', {
  inserted: function (el, binding) {
    el.onclick = function () {
      console.log('binding.value', binding.value)
      document.documentElement.scrollTop = document.getElementById(
        'anchor-' + binding.value
      ).offsetTop
    }
  }
})
